This function block multiplies a matrix of the data type ARRAY[*,*] of LREAL with a scalar.
Example for 2x2 matrix:
B = b * A = \begin{bmatrix} b*a_{11} & b*a_{12} \\ b*a_{21} & b*a_{22} \end{bmatrix}A matrix is multiplied by a scalar, thereby multiplying each matrix element by the scalar. The result is output in the matrixResult matrix.
| LGF_MatrixScalarMultiplication (FC) | ||||||||
|---|---|---|---|---|---|---|---|---|
| LReal | scalar | Ret_Val | Void | |||||
| error | Bool | |||||||
| status | Word | |||||||
| Array[*, *] of LReal | matrixInput | Array[*, *] of LReal | ||||||
| Array[*, *] of LReal | matrixResult | Array[*, *] of LReal | ||||||
| Identifier | Data type | Description |
|---|---|---|
| scalar | LReal | Scalar value where the matrix is multiplied |
| Identifier | Data type | Description |
|---|---|---|
| Ret_Val | Void | Void - Function has no return value |
| error | Bool | FALSE: No error TRUE: An error occurred during the execution of the FB |
| status | Word | 16#0000-16#7FFF: Status of the FB 16#8000-16#FFFF: Error identification (see following Table) |
| Identifier | Data type | Description |
|---|---|---|
| matrixInput | Array[*, *] of LReal | Matrix to multiply |
| matrixResult | Array[*, *] of LReal | The result matrix of the multiplication |
| Code / Value | Identifier / Description |
|---|---|
| 16#0000 | STATUS_NO_ERROR Execution finished without errors |
| 16#8201 | ERR_MATRICES_LOWER_BOUND_ROWS_DONT_MATCH Error: Matrices lower bound rows(Dim1) do not match |
| 16#8202 | ERR_MATRICES_UPPER_BOUND_ROWS_DONT_MATCH Error: Matrices upper bound rows(Dim1) do not match |
| 16#8203 | ERR_MATRICES_LOWER_BOUND_COLUMNS_DONT_MATCH Error: Matrices lower bound columns(Dim2) do not match |
| 16#8204 | ERR_MATRICES_UPPER_BOUND_COLUMNS_DONT_MATCH Error: Matrices upper bound columns(Dim2) do not match |
| Version & Date | Change description | |
|---|---|---|
| 01.00.00 | Simatic Systems Support | |
| 11.12.2019 | First released version based on "LGF_MatrixMultiplication" | |
| 03.00.00 | Simatic Systems Support | |
| 23.04.2020 | Set version to V3.0.0, harmonize the version of the whole library | |
| 03.00.01 | Simatic Systems Support | |
| 02.02.2020 | Insert documentation | |